<template>
  <!--  -->
  <layout title=" " :background="isBro ? '#fff' : '#617fb9'">
    <view slot="left"> </view>
    <div class="download" v-if="isBro">即将下载应用...</div>
    <div class="mask" v-else></div>
  </layout>
</template>
<script>
import { isAndroid } from "@/common/bridge.js";
export default {
  name: "download",
  data() {
    return {
      androidUrl: "",
      iosDownUrl: "",
      isBro: false,
    };
  },
  mounted() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
      uni.showToast({
        title: "检测到当前处于微信浏览器，请在系统浏览器内打开",
        icon: "none",
      });
      return;
    } else {
      this.isBro = true;
      this.androidUrl = this.vuex_h5Config.andrDownUrl;
      this.iosDownUrl = this.vuex_h5Config.iosDownUrl;
      this.jump();
    }
  },
  methods: {
    jump() {
      const _this = this;
      setTimeout(() => {
        if (isAndroid) {
          window.location.href = _this.androidUrl;
        } else {
          window.location.href = _this.iosDownUrl;
        }
      }, 2000);
    },
  },
  computed: {},
  onLoad(option) {},
  onShow() {},
  onReady() {},
  watch: {},
};
</script>
<style lang="scss">
.download {
  height: 100%;
  background: #fff;
  padding: 35rpx 30rpx;
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 400;
  color: #4b4b4b;
  line-height: 44rpx;
  text-indent: 2em;
}
.mask {
  background-color: #617fb9;
  height: 100%;
  padding: 150rpx;
  background-image: url("https://harry-run-prod.oss-cn-zhangjiakou.aliyuncs.com/img/good/photo/2022-04-03/79a0cd3c-bdcc-48b4-91ba-f41a96.png");
  background-repeat: no-repeat;
  background-size: contain;
}
</style>
